package com.zmn.oms.services.interfaces.part;

import com.zmn.oms.model.dto.work.modify.other.ZsPartReimburseDTO;
import com.zmn.oms.model.entity.part.OrderPart;

import java.util.List;


/**
 * 类描述：订单配件
 *
 * @author heciqi
 * @date 2018/11/28 11:08
 */
public interface OrderPartService {

    /**
     * 按订单id查询，如果有老仓储配件信息，则返回new ArrayList()
     *
     * @param orderId
     * @return
     */
    List<OrderPart> listByOrderId(Long orderId);

    /**
     * 按订单id查询
     *
     * @param orderId
     * @return
     */
    List<OrderPart> listOrderPartByOrderId(Long orderId);

    /**
     * 按订单id查询（查主库）
     *
     * @param orderId
     * @return
     */
    List<OrderPart> listByOrderIdSrcMaster(Long orderId);

    /**
     * 根据类型查询配件
     *
     * @param orderId
     * @param partType
     * @return
     */
    List<OrderPart> listByOrderId(Long orderId, Integer partType);

    /**
     * 根据类型查询配件（主库）
     *
     * @param orderId
     * @param partType
     * @return
     */
    List<OrderPart> listByOrderIdSrcMaster(Long orderId, Integer partType);

    /**
     * 按订单id和工程师id查询
     *
     * @param orderId
     * @param masterId
     * @return
     */
    List<OrderPart> listByOrderIdAndMasterId(Long orderId, Integer masterId);

    /**
     * 根据订单Id查询es工单配件
     *
     * @param orderIdList
     * @return
     */
    List<OrderPart> listEsOrderPartByOrderIdList(List<Long> orderIdList);

    /**
     * 根据订单id和报销id查询配件列表
     * @param orderId
     * @param reimburseId
     * @return java.util.List<com.zmn.oms.model.entity.part.OrderPart>
     * @author wangxiaokun
     */
    List<OrderPart> listByOrderIdAndReimburseId(Long orderId, String reimburseId);

    /**
     * 根据订单id和报销id查询配件列表（主库）
     *
     * @param orderId
     * @param reimburseId
     * @return java.util.List<com.zmn.oms.model.entity.part.OrderPart>
     * @author wangxiaokun
     */
    List<OrderPart> listByOrderIdAndReimburseIdSrcMaster(Long orderId, String reimburseId);

    /**
     * 新增工单配件
     *
     * @param orderParts
     * @return
     */
    Integer insertAll(List<OrderPart> orderParts);

    /**
     * 删除工单配件
     *
     * @param orderId
     * @return
     */
    Integer deleteByOrderId(Long orderId);

    /**
     * 删除配件
     *
     * @param orderId
     * @return
     */
    Integer deleteByOrderIdAndPartType(Long orderId, Integer partType);
    
    /**
     * 根据订单id和报销id删除配件
     * @param orderId
     * @param reimburseId
     * @return java.lang.Integer
     * @author wangxiaokun
     */
    Integer deleteByOrderIdAndReimburseId(Long orderId, String reimburseId);

    /**
     * 修改配件单价
     * @param list
     * @return
     */
    Integer updateOrderPartPriceByOrderId(ZsPartReimburseDTO list);

    /**
     * 根据【报销单号】修改订单配件的【报销状态】
     *
     * @param orderId         订单id【用于分表】
     * @param reimburseId     报销单号
     * @param reimburseStatus 报销结果
     * @return
     */
    Integer updateReimburseStatusByReimburseId(Long orderId, String reimburseId, Integer reimburseStatus);

    /**
     * 修改结算主体
     * @param orderPart
     * @return
     */
    Integer updateSettlementSubjectTypeByOrderPartId (OrderPart orderPart);

    /**
     * 修改图片识别结果
     * @param orderPart
     * @return
     */
    Integer updateAiStatusByOrderPartId (OrderPart orderPart);

}
